From 911b09d74b919400ed8fb395fb5533ab7d045025 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Wed, 18 Aug 2004 14:27:38 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.76 (4123675aNWvu0fGFgPa2aJkfXqPOBg) temporary blkfront fix to mark pages dirty during migrate -- should be deleted when grant tables are enabled. --- .../drivers/xen/blkfront/blkfront.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c index 1a92d7d8b7..5a3a45873f 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -61,6 +61,7 @@ static void kick_pending_request_queues(void); int __init xlblk_init(void); +void blkif_completion( blkif_request_t *req ); static inline int GET_ID_FROM_FREELIST( void ) { @@ -359,6 +360,8 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs) //printk(KERN_ALERT"i: %d req %p (%ld)\n",i,req,id); + blkif_completion( &rec_ring[id] ); + ADD_ID_TO_FREELIST(id); // overwrites req switch ( bret->operation ) @@ -891,6 +894,8 @@ static void blkif_int(int irq, void *dev_id, struct pt_regs *ptregs) //printk("i: %d req %p (%ld)\n",i,bh,id); + blkif_completion( &rec_ring[id] ); + ADD_ID_TO_FREELIST(id); switch ( bret->operation ) @@ -1262,3 +1267,27 @@ void blkdev_resume(void) memcpy(cmsg.msg, &st, sizeof(st)); ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE); } + +/* XXXXX THIS IS A TEMPORARY FUNCTION UNTIL WE GET GRANT TABLES */ + +void blkif_completion( blkif_request_t *req ) +{ + int i; + + switch ( req->operation ) + { + case BLKIF_OP_READ: + for ( i = 0; i < req->nr_segments; i++ ) + { + unsigned long pfn = req->frame_and_sects[i] >> PAGE_SHIFT; + unsigned long mfn = phys_to_machine_mapping[pfn]; + + queue_machphys_update(mfn, pfn); + } + + break; + } + +} + + -- 2.30.2